--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Commit 96300a80163d6a032a8d0aa925495f712d9bd8ac
Parents : b06a832
Author : Sudo-Ivan <ivan@quad4.io>
Signature : Signature validation error
Date : 2026-01-01T18:29:52-06:00
feat(nginx): enhance demo configuration with caching headers, gzip compression, and improved asset handling
Changes
Diff
diff --git a/nginx.demo.conf b/nginx.demo.conf
index c8de606e..7b2e9b8c 100644
--- a/nginx.demo.conf
+++ b/nginx.demo.conf
@@ -2,6 +2,9 @@ server {
listen 8080;
server_name localhost;
+ absolute_redirect off;
+ port_in_redirect off;
+
include /etc/nginx/mime.types;
default_type application/octet-stream;
@@ -11,20 +14,30 @@ server {
# Support for SPA routing
location / {
try_files $uri $uri/ /index.html;
+ add_header Cache-Control "no-cache";
}
# Don't serve index.html for missing assets
- location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot|wasm|json)$ {
- try_files $uri =404;
+ location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot|wasm|json|proto)$ {
add_header Cache-Control "public, max-age=31536000, immutable";
+ access_log off;
+ try_files $uri =404;
}
- # Handle manifest.json specifically if needed
- location = /manifest.json {
+ # Handle manifest.json and service-worker.js specifically
+ location ~* (manifest\.json|service-worker\.js) {
+ add_header Cache-Control "no-cache";
try_files $uri =404;
}
- # Mock API responses for demo mode
+ # Gzip compression
+ gzip on;
+ gzip_vary on;
+ gzip_proxied any;
+ gzip_comp_level 6;
+ gzip_types text/plain text/css text/xml application/json application/javascript application/rss+xml application/atom+xml image/svg+xml;
+
+ # Mock responses for demo mode with the power of NGINX!
location /api/v1/auth/status {
return 200 '{"auth_enabled": false, "authenticated": true}';
add_header Content-Type application/json;
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────